#ifndef __CE_GFX_GL20_PROGRAM_GL20_H__
#define __CE_GFX_GL20_PROGRAM_GL20_H__

#include <export.h>
#include <gfx/iprogram.h>
#include <gfx/gl20/programparameter_gl20.h>
#include <GL/glew.h>
#include <vector>


/**
 * @brief OpenGL 2.0 implemenation of the iProgram interface
 */
class ceProgramGL20 : public iProgram
{
	CE_OBJECT
private:
	GLuint _name;

	std::vector<ceProgramParameterGL20*>	_parameterBindings;

	ceProgramParameterGL20* GetParameterByName (const std::string& name);

	void ClearParameterBindings ();
	void PrepareBindings (unsigned numberOfBindings);
public:
	ceProgramGL20 ();
	virtual ~ceProgramGL20 ();

	GLuint GetName () const;

	void ClearShaders ();
	void AttachShader (iShader* shader);
	void DetachShader (iShader* shader);
	bool Link ();
	std::string GetLinkInfoLog () const;

	void Bind ();

	virtual void RegisterSemantic (const ceProgramParameterName& name, const std::string& parameterName);
	virtual ceProgramParameterGL20* GetParameter(const ceProgramParameterName& name);

};

#endif /* ! __CE_GFX_GL20_PROGRAM_GL20_H__ */
